package 每日一题OJ;

/**
 * @author shy_black
 * @date 2019/8/19 22:46
 * @Description:
 */
public class _485_最大连续1的个数 {

    public int findMaxConsecutiveOnes(int[] nums) {
        int len = 0;
        int tmp = 0;
        for(int i = 0;i < nums.length;i++) {
            if(nums[i] == 0)
                tmp = 0;
            else{
                tmp++;
                if(tmp > len)
                    len = tmp;
            }

        }
        return len;
    }
}